<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op']=='get'){
	$item=array();
	$return['item']=$item;
	$htmls=array(
		'type'=>'edit',
		'post'=>'set',
		'desc'=>'批量发货',
		'edit'=>array(
			'0'=>array('type'=>'select','title'=>'选择快递','name'=>'express','options'=>'express','option_title'=>'name'),
			'1'=>array('type'=>'upfile','title'=>'上传文件','name'=>'file'),
			
		)
	);
	$return['express']=Array ('0' => Array ( 'id'=> 1, 'name' => '顺丰快递' ), '1' => Array ( 'id' => 2, 'name' => '申通快递' ) ,'2' => Array ( 'id' => 3,'name' => '韵达快运' ), '3' => Array ('id' => 4, 'name' => '天天快递' ), '4' => Array ( 'id' => 5, 'name' => '圆通速递' ) ,'5' => Array ( 'id' => 6,'name' => '中通速递' ) ,'6' => Array ( 'id' => 7 ,'name' => 'ems快递' ), '7' => Array ( 'id' => 8, 'name' => '汇通快运' ), '8' => Array ( 'id' => 9, 'name' => '其它快递' )); 
	$return['htmls']=$htmls;	
	exi($return);
}
if($_RQ['op']=='set'){
$post=get_postdata();
$file=ROOT_AT.$post['file'];
$data=cfc('tools')->importExcel($file);
foreach($data as $v){
	$ex=array('express'=>$post['express'],'expresssn'=>$v['1'],'status'=>'2');
	pdo_update('jy_weishop_order',$ex,array('ordersn'=>$v['0']));
}
exi('批量发货成功','','jy_weishop/order.list/status2');
}